English 中文(简体)
一个带有Qt的GUI的“About”信息箱
原标题:An "About" message box for a GUI with Qt
    QMessageBox::about( this, "About Application",
    "<h4>Application is a one-paragraph blurb</h4>

"
"Copyright 1991-2003 Such-and-such. "
"For technical support, call 1234-56789 or see
"
"<a href="http://www.such-and-such.com">http://www.such-and-such.com</a>" );

该守则正在创建我希望有两种例外的“信息箱”:

(1) 我愿用aa.png文档改变电文箱中的icon。

2) 我愿点击链接。 它像超文本链接(蓝色和强调)一样,但 mo点不可行。

任何想法?

最佳回答

我认为,你应为你们的植被创造一种习惯()。 这样,你就能够把你们想要的所有东西get上。 举例来说,请在开放式外部链接。 用于可点击链接的财产。

http://www.greyc.ensicaen.fr/ensicaen/Docs/Qt4/widgets-imageviewer.html 可能提供帮助。

问题回答

就icon而言,你只需要确定申请表。 与此类似:

QApplication::setWindowIcon(QIcon(":/aaa.png")); // from a resource file

关于可点击这些链接,我不认为可以通过<代码>查询。 QMessageBox:about 页: 1

QMessageBox msgBox;
msgBox.setTextFormat(Qt::RichText); // this does the magic trick and allows you to click the link
msgBox.setText("Text<br /><a href="http://www.such-and-such.com">http://www.such-and-such.com</a>");
msgBox.setIcon(yourIcon);
msgBox.exec();

there s a message in the qtcenter about it: http://www.qtcentre.org/threads/17365-Clickable-URL-in-QMessageBox

http://doc.qt.nokia.com/latest/qlabel.html#setOpenExternalLinks”rel=“nofollow”http://doc.qt.nokia.com/latest/qlabel.html#setOpenExternalLinks

<>strong>main.cpp

QApplication app(argc, argv);
app.setWindowIcon(QIcon(":/images/your_icon.png"));

<>strong>mainwindow.cpp (如果你有的话)

void MainWindow::on_aboutAction_triggered()
{
    QMessageBox::about(0, "window title", "<a href= http://www.jeffersonpalheta.com >jeffersonpalheta.com</a>");
}




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签