本文整理汇总了C++中QLabel::setMaximumSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QLabel::setMaximumSize方法的具体用法?C++ QLabel::setMaximumSize怎么用?C++ QLabel::setMaximumSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLabel
的用法示例。
在下文中一共展示了QLabel::setMaximumSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createToolBars
void BitcoinGUI::createToolBars()
{
toolbar = new QToolBar(tr("Tabs toolbar"));
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
toolbar->setObjectName("tabs");
toolbar->setStyleSheet("QToolButton { color: #ffffff; } } #tabs { color: #ffffff; background-color: #37c5db;}");
QLabel* header = new QLabel();
header->setMinimumSize(96, 96);
header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
header->setPixmap(QPixmap(":/images/header"));
header->setMaximumSize(96,96);
header->setScaledContents(true);
toolbar->addWidget(header);
//QMenu *toolbarMenu = new QMenu();
toolbar->addAction(overviewAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(masternodeManagerAction);
toolbar->addAction(richListPageAction);
toolbar->addAction(messageAction);
toolbar->setOrientation(Qt::Horizontal);
toolbar->setMovable(false);
addToolBar(Qt::TopToolBarArea, toolbar);
}
示例2: createToolBars
void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setObjectName("toolbar");
addToolBar(Qt::LeftToolBarArea,toolbar);
toolbar->setOrientation(Qt::Vertical);
toolbar->setFixedWidth(205);
toolbar->setMovable( false );
toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);
QLabel* header = new QLabel();
header->setMinimumSize(156,156);
header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
header->setPixmap(QPixmap(":/images/header"));
header->setMaximumSize(156,156);
header->setContentsMargins(26,26,0,0);
header->setScaledContents(true);
toolbar->addWidget(header);
QLabel *l = new QLabel(this);
l->setPixmap(QPixmap(":/images/spacer"));
toolbar->addWidget(l);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->setStyleSheet("#toolbar {background: transparent; text-align: center; color: black;padding-right: 30px;} QToolBar QToolButton:hover {background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton {font-family:Steps; font-size:15px; font-weight: bold; min-width:125px;max-width:125px; min-height:25px;max-height:25px; color: white; text-align: left; }");
}
示例3: createToolBars
void BitcoinGUI::createToolBars()
{
toolbar = new QToolBar(tr("Tabs toolbar"));
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
toolbar->setObjectName("tabs");
toolbar->setStyleSheet("QToolButton { color: #ffffff; } QToolButton:hover { background-color: #050817 } QToolButton:checked { background-color: #152443 } QToolButton:pressed { background-color: #152443 } #tabs { color: #ffffff; background-color: qradialgradient(cx: -0.8, cy: 0, fx: -0.8, fy: 0, radius: 0.6, stop: 0 #404040, stop: 1 #101010); }");
QLabel* header = new QLabel();
header->setMinimumSize(48, 48);
header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
header->setPixmap(QPixmap(":/icons/bitcoin"));
header->setMaximumSize(48,48);
header->setScaledContents(true);
toolbar->addWidget(header);
//QMenu *toolbarMenu = new QMenu();
toolbar->addAction(overviewAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(masternodeManagerAction);
toolbar->addAction(messageAction);
toolbar->setOrientation(Qt::Horizontal);
toolbar->setMovable(false);
addToolBar(Qt::TopToolBarArea, toolbar);
}
示例4: setChannels
void ChannelWidget::setChannels(const QList<DoubanChannel>& channels) {
this->channels = channels;
int curindex = 0;
QList<QWidget *> labels;
for (int i = 0; i < channels.size(); ++ i) {
const DoubanChannel& channel = channels[i];
QLabel *label = new QLabel(ui->slider);
QFont font("Sans", 12);
font.setStyleStrategy(QFont::PreferAntialias);
label->setFont(font);
label->setText(channel.name+" MHz");
label->setStyleSheet(DARK_STYLE);
label->setMinimumSize(ui->slider->width() / 3, ui->slider->height());
label->setMaximumSize(ui->slider->width() / 3, ui->slider->height());
label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
labels.append(label);
if (channel.channel_id == this->channel) curindex = i;
qDebug() << "Channel name=" << channel.name << " id=" << channel.channel_id;
}
ui->slider->setChildren(labels);
ui->slider->scrollToIndex(curindex);
ui->slider->currentObject()->setStyleSheet(HIGHTLIGHT_STYLE);
//pnt->setText(pnt->text().replace("grey", "white").replace("<a>", "<b>").replace("</a>", "</b>"));
}
示例5: QLabel
QLayout *AboutDlg::initTitleLayout()
{
// The title layout has the product title, a picture, a horizontal
// user guide layout, and a GPL 3 label.
titleLabel = new QLabel();
titleLabel->setMaximumSize(250, 64);
titleLabel->setAlignment(Qt::AlignCenter);
QLabel * tombImage = new QLabel();
tombImage->setMaximumSize(250, 250);
tombImage->setPixmap(QPixmap(":/images/tomb.png"));
tombImage->setScaledContents(true);
tombImage->setAlignment(Qt::AlignCenter);
gplLabel = new QLabel();
gplLabel->setMaximumSize(250, 32);
gplLabel->setAlignment(Qt::AlignCenter);
QVBoxLayout * titleLayout = new QVBoxLayout();
titleLayout->setSpacing(15);
titleLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));
titleLayout->addWidget(titleLabel);
titleLayout->addWidget(tombImage);
titleLayout->addLayout(initUserGuideLayout());
titleLayout->addWidget(gplLabel);
titleLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));
return titleLayout;
}
示例6: addCopy
void Progression::addCopy(QString src, QString){
QLabel * label = new QLabel(src, this);
label->setObjectName(src);
label->setMaximumSize(780, 30);
label->setGeometry(label->x(), label->y(), 780, label->height());
QProgressBar * prog = new QProgressBar(this);
prog->setObjectName(src);
prog->setMaximum(QFile(src).size());
vbl->addWidget(label);
vbl->addWidget(prog);
ProgressBars[label->text()] = prog;
qDebug() << label->text();
this->adjustSize();
}
示例7: displayPictures
void MainWindow::displayPictures(QList<ImageTags*>* imgs)
{
if (imgs->size() <= 0)
{
ui->PhotoTable->clear();
ui->PhotoTable->setRowCount(0);
ui->PhotoTable->setColumnCount(0);
ui->tags->clear();
return;
}
m_selected_picture = 0;
ui->PhotoTable->clear();
int nbFiles = imgs->size();
// Get the available size of the element PhotoTable on screen
QSize tableSize = ui->PhotoTable->size();
// Define the optimal number of rows and columns
int nbColumns = (int) floor((double) tableSize.width()
/ (double) minImageSize.width());
if (nbColumns > nbFiles)
nbColumns = nbFiles;
int nbRows = (int) ceil((double) nbFiles / (double) nbColumns);
ui->PhotoTable->setColumnCount(nbColumns);
ui->PhotoTable->setRowCount(nbRows);
// Maximise the width of the pictures
int extraWidth = tableSize.width() - (nbColumns * minImageSize.width());
extraWidth /= nbColumns;
if (extraWidth >= (0.10 * minImageSize.width()))
extraWidth = 0;
for (int i = 0 ; i < imgs->size() ; i++)
{
QLabel* img = new QLabel();
img->setMaximumSize(QSize(minImageSize.width() + extraWidth,
minImageSize.height()));
QPixmap scaledPicture(imgs->at(i)->m_filename);
scaledPicture = scaledPicture.scaled(
QSize(
minImageSize.width() + extraWidth,
minImageSize.height()),
Qt::KeepAspectRatio);
img->setPixmap(scaledPicture);
ui->PhotoTable->setCellWidget((int) floor((double) i / (double) nbColumns),
i % nbColumns,
img);
}
}
示例8: createToolBars
void DarkSilkGUI::createToolBars() {
QLabel* header = new QLabel();
header->setMinimumSize(48, 48);
header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
header->setPixmap(QPixmap(":/icons/darksilk"));
header->setMaximumSize(48, 48);
header->setScaledContents(true);
toolbar = new QToolBar(tr("Tabs toolbar"));
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
toolbar->setObjectName("tabs");
toolbar->setStyleSheet("#tabs { background-color: qradialgradient(cx: -0.8, cy: 0, fx: -0.8, fy: 0, radius: 0.6, stop: 0 #000000, stop: 1 #000000); }");
toolbar->addWidget(header);
QMenu *toolbarMenu = new QMenu();
toolbarMenu->addAction(overviewAction);
toolbarMenu->addAction(receiveCoinsAction);
toolbarMenu->addAction(sendCoinsAction);
toolbarMenu->addAction(historyAction);
toolbarMenu->addAction(addressBookAction);
toolbarMenu->addAction(statisticsAction);
toolbarMenu->addAction(blockAction);
toolbarMenu->addAction(stormnodeManagerAction);
QAction* menuAction = new QAction(QIcon(":/icons/overview"), tr("&Menu"), this);
menuAction->setToolTip(tr("Access DarkSilk Wallet Tabs"));
menuAction->setCheckable(false);
QToolButton* menuToolButton = new QToolButton();
menuToolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
menuToolButton->setMenu(toolbarMenu);
menuToolButton->setPopupMode(QToolButton::InstantPopup);
menuToolButton->setDefaultAction(menuAction);
netLabel = new QLabel();
netLabel->setObjectName("netLabel");
netLabel->setStyleSheet("#netLabel { color: #ffffff; }");
toolbar->addWidget(menuToolButton);
toolbar->addWidget(makeToolBarSpacer());
toolbar->addWidget(netLabel);
toolbar->setOrientation(Qt::Horizontal);
toolbar->setMovable(false);
addToolBar(Qt::TopToolBarArea, toolbar);
}
示例9: addMessage
void NotificationWidget::addMessage(QString msg, QPixmap pic) {
//#ifndef Q_WS_MAC
QHBoxLayout *l = new QHBoxLayout();
QLabel *w = new QLabel();
w->setMaximumSize(16,16);
w->setPixmap(pic);
w->setScaledContents(true);
l->addWidget(w);
w=new QLabel();
w->setText(msg);
l->addWidget(w);
((QBoxLayout*)layout())->addLayout(l);
//#endif
//#ifdef Q_WS_MAC
// icons.append(pic);
// text.append(msg);
//#endif
}
示例10: QHBoxLayout
AMWorkflowView3::AMWorkflowView3(AMActionRunner3 *actionRunner, QWidget *parent) :
QWidget(parent)
{
layoutSpacer_ = 0;
QHBoxLayout* hl = new QHBoxLayout();
hl->setContentsMargins(12,12,12,12);
hl->setSpacing(12);
QLabel* titleIcon = new QLabel();
titleIcon->setMaximumSize(36,36);
titleIcon->setPixmap(QPixmap(":/user-away.png"));
titleIcon->setScaledContents(true);
hl->addWidget(titleIcon);
QLabel* titleLabel = new QLabel(actionRunner->actionRunnerTitle());
titleLabel->setStyleSheet("font: " AM_FONT_XLARGE_ "pt \"Lucida Grande\";\ncolor: rgb(79, 79, 79);");
hl->addWidget(titleLabel);
hl->addStretch(1);
addActionButton_ = new QPushButton("Add Action...");
hl->addWidget(addActionButton_);
currentView_ = new AMActionRunnerCurrentView3(actionRunner);
queueView_ = new AMActionRunnerQueueView3(actionRunner);
historyView_ = new AMActionHistoryView3(actionRunner, actionRunner->loggingDatabase());
addActionDialog_ = 0;
QVBoxLayout* vl = new QVBoxLayout();
vl->setContentsMargins(0,0,0,0);
vl->setSpacing(0);
vl->addLayout(hl);
vl->addWidget(historyView_);
vl->addSpacing(12);
vl->addWidget(currentView_);
vl->addSpacing(12);
vl->addWidget(queueView_);
setLayout(vl);
connect(queueView_, SIGNAL(collapsed(bool)), this, SLOT(onViewCollapsed()));
connect(historyView_, SIGNAL(collapsed(bool)), this, SLOT(onViewCollapsed()));
connect(addActionButton_, SIGNAL(clicked()), this, SLOT(onAddActionButtonClicked()));
}
示例11: connect
InfoBox::InfoBox(QWidget * parent):QWidget (parent)
{
//Set up title bar
m_titleBar = new QWidget;
m_titleBar->setAutoFillBackground(true);
m_titleBar->setPalette(QApplication::palette());
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(updateTitleColors()));
QHBoxLayout * titleLayout = new QHBoxLayout;
titleLayout->setContentsMargins(0,0,0,0);
titleLayout->setSpacing(0);
m_icon = new QLabel;
m_icon->setMaximumSize(QSize(20,20));
m_icon->setAlignment(Qt::AlignCenter);
m_title = new QLabel;
m_title->setFont(KGlobalSettings::smallestReadableFont());
m_title->setAlignment(Qt::AlignCenter);
QLabel * spacer = new QLabel;
spacer->setMaximumSize(QSize(20,20));
titleLayout->addWidget(m_icon);
titleLayout->addWidget(m_title);
titleLayout->addWidget(spacer);
m_titleBar->setLayout(titleLayout);
m_titleBar->setMinimumHeight(20);
//Set up media view
QVBoxLayout * layout = new QVBoxLayout;
layout->setContentsMargins(0,0,0,0);
layout->setSpacing(0);
m_mediaView = new MediaView();
m_mediaView->setFocusPolicy(Qt::ClickFocus);
connect((MediaItemModel *)m_mediaView->sourceModel(), SIGNAL(mediaListChanged()), this, SLOT(mediaListChanged()));
layout->addWidget(m_titleBar);
layout->addWidget(m_mediaView);
//Complete setup
setLayout(layout);
}
示例12: icon
QLayout * ToolTipManager::generateToolTipLine( QModelIndex * item, QWidget * toolTip, QSize iconSize, bool comment )
{
// Get MenuItem
MenuItem * menuItem = d->view->model()->data( *item, Qt::UserRole ).value<MenuItem*>();
QString text = menuItem->name();
if ( comment ) {
text = QString( "<b>%1</b>" ).arg( menuItem->name() );
}
// Generate text
if ( comment ) {
text += "<br />";
if ( !menuItem->service()->comment().isEmpty() ) {
text += menuItem->service()->comment();
} else {
int childCount = d->view->model()->rowCount( *item );
text += i18np( "<i>Contains 1 item</i>", "<i>Contains %1 items</i>", childCount );
}
}
QLabel * textLabel = new QLabel( toolTip );
textLabel->setForegroundRole(QPalette::ToolTipText);
textLabel->setText( text );
// Get icon
KIcon icon( menuItem->service()->icon() );
QLabel * iconLabel = new QLabel( toolTip );
iconLabel->setPixmap( icon.pixmap(iconSize) );
iconLabel->setMaximumSize( iconSize );
// Generate layout
QHBoxLayout * layout = new QHBoxLayout();
layout->addWidget( iconLabel );
layout->addWidget( textLabel );
return layout;
}
示例13: addFormInfo
void OpenconnectAuthWidget::addFormInfo(const QString &iconName, const QString &message)
{
Q_D(OpenconnectAuthWidget);
QHBoxLayout *layout = new QHBoxLayout();
QLabel *icon = new QLabel(this);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(icon->sizePolicy().hasHeightForWidth());
icon->setSizePolicy(sizePolicy);
icon->setMinimumSize(QSize(16, 16));
icon->setMaximumSize(QSize(16, 16));
layout->addWidget(icon);
QLabel *text = new QLabel(this);
text->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
text->setWordWrap(true);
layout->addWidget(text);
icon->setPixmap(QIcon::fromTheme(iconName).pixmap(KIconLoader::SizeSmall));
text->setText(message);
d->ui.loginBoxLayout->addLayout(layout);
}
示例14: setupUi
void setupUi(QMainWindow *Detection)
{
if (Detection->objectName().isEmpty())
Detection->setObjectName(QString::fromUtf8("Detection"));
Detection->resize(729, 480);
actionE_xit = new QAction(Detection);
actionE_xit->setObjectName(QString::fromUtf8("actionE_xit"));
action_Load_Map = new QAction(Detection);
action_Load_Map->setObjectName(QString::fromUtf8("action_Load_Map"));
action_Connect = new QAction(Detection);
action_Connect->setObjectName(QString::fromUtf8("action_Connect"));
action_Disconnect = new QAction(Detection);
action_Disconnect->setObjectName(QString::fromUtf8("action_Disconnect"));
centralWidget = new QWidget(Detection);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
gridLayoutWidget = new QWidget(centralWidget);
gridLayoutWidget->setObjectName(QString::fromUtf8("gridLayoutWidget"));
gridLayoutWidget->setGeometry(QRect(0, 0, 721, 421));
gridLayout = new QGridLayout(gridLayoutWidget);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(11, 11, 11, 11);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
gridLayout->setSizeConstraint(QLayout::SetNoConstraint);
gridLayout->setVerticalSpacing(5);
gridLayout->setContentsMargins(0, 0, 0, 0);
ugvFeedLabel = new QLabel(gridLayoutWidget);
ugvFeedLabel->setObjectName(QString::fromUtf8("ugvFeedLabel"));
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(ugvFeedLabel->sizePolicy().hasHeightForWidth());
ugvFeedLabel->setSizePolicy(sizePolicy);
gridLayout->addWidget(ugvFeedLabel, 1, 2, 1, 1);
connectionButton = new QCommandLinkButton(gridLayoutWidget);
connectionButton->setObjectName(QString::fromUtf8("connectionButton"));
gridLayout->addWidget(connectionButton, 0, 2, 1, 1);
uavFeedLabel = new QLabel(gridLayoutWidget);
uavFeedLabel->setObjectName(QString::fromUtf8("uavFeedLabel"));
sizePolicy.setHeightForWidth(uavFeedLabel->sizePolicy().hasHeightForWidth());
uavFeedLabel->setSizePolicy(sizePolicy);
uavFeedLabel->setMaximumSize(QSize(16777215, 16777215));
gridLayout->addWidget(uavFeedLabel, 1, 0, 1, 1);
ugvMapLabel = new QLabel(gridLayoutWidget);
ugvMapLabel->setObjectName(QString::fromUtf8("ugvMapLabel"));
QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
sizePolicy1.setHeightForWidth(ugvMapLabel->sizePolicy().hasHeightForWidth());
ugvMapLabel->setSizePolicy(sizePolicy1);
gridLayout->addWidget(ugvMapLabel, 1, 3, 1, 1);
horizontalLayout_4 = new QHBoxLayout();
horizontalLayout_4->setSpacing(6);
horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
label_2 = new QLabel(gridLayoutWidget);
label_2->setObjectName(QString::fromUtf8("label_2"));
horizontalLayout_4->addWidget(label_2);
uavTakeoffLandButton = new QPushButton(gridLayoutWidget);
uavTakeoffLandButton->setObjectName(QString::fromUtf8("uavTakeoffLandButton"));
horizontalLayout_4->addWidget(uavTakeoffLandButton);
gridLayout->addLayout(horizontalLayout_4, 2, 0, 1, 1);
horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setSpacing(6);
horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
label = new QLabel(gridLayoutWidget);
label->setObjectName(QString::fromUtf8("label"));
horizontalLayout_2->addWidget(label);
ugvSpeedLCD = new QLCDNumber(gridLayoutWidget);
ugvSpeedLCD->setObjectName(QString::fromUtf8("ugvSpeedLCD"));
ugvSpeedLCD->setFrameShape(QFrame::Box);
horizontalLayout_2->addWidget(ugvSpeedLCD);
gridLayout->addLayout(horizontalLayout_2, 4, 2, 1, 1);
horizontalLayout_6 = new QHBoxLayout();
horizontalLayout_6->setSpacing(6);
horizontalLayout_6->setObjectName(QString::fromUtf8("horizontalLayout_6"));
label_3 = new QLabel(gridLayoutWidget);
label_3->setObjectName(QString::fromUtf8("label_3"));
horizontalLayout_6->addWidget(label_3);
ugvSpeakerButton = new QPushButton(gridLayoutWidget);
//.........这里部分代码省略.........
示例15: VBoxDbgBaseWindow
VBoxDbgConsole::VBoxDbgConsole(VBoxDbgGui *a_pDbgGui, QWidget *a_pParent/* = NULL*/, IVirtualBox *a_pVirtualBox/* = NULL */)
: VBoxDbgBaseWindow(a_pDbgGui, a_pParent, "Console"), m_pOutput(NULL), m_pInput(NULL), m_fInputRestoreFocus(false),
m_pszInputBuf(NULL), m_cbInputBuf(0), m_cbInputBufAlloc(0),
m_pszOutputBuf(NULL), m_cbOutputBuf(0), m_cbOutputBufAlloc(0),
m_pTimer(NULL), m_fUpdatePending(false), m_Thread(NIL_RTTHREAD), m_EventSem(NIL_RTSEMEVENT),
m_fTerminate(false), m_fThreadTerminated(false)
{
/*
* Create the output text box.
*/
m_pOutput = new VBoxDbgConsoleOutput(this, a_pVirtualBox);
/* try figure a suitable size */
QLabel *pLabel = new QLabel( "11111111111111111111111111111111111111111111111111111111111111111111111111111112222222222", this);
pLabel->setFont(m_pOutput->font());
QSize Size = pLabel->sizeHint();
delete pLabel;
Size.setWidth((int)(Size.width() * 1.10));
Size.setHeight(Size.width() / 2);
resize(Size);
/*
* Create the input combo box (with a label).
*/
QHBoxLayout *pLayout = new QHBoxLayout();
//pLayout->setSizeConstraint(QLayout::SetMaximumSize);
pLabel = new QLabel(" Command ");
pLayout->addWidget(pLabel);
pLabel->setMaximumSize(pLabel->sizeHint());
pLabel->setAlignment(Qt::AlignCenter);
m_pInput = new VBoxDbgConsoleInput(NULL);
pLayout->addWidget(m_pInput);
m_pInput->setDuplicatesEnabled(false);
connect(m_pInput, SIGNAL(commandSubmitted(const QString &)), this, SLOT(commandSubmitted(const QString &)));
# if 0//def Q_WS_MAC
pLabel = new QLabel(" ");
pLayout->addWidget(pLabel);
pLabel->setMaximumSize(20, m_pInput->sizeHint().height() + 6);
pLabel->setMinimumSize(20, m_pInput->sizeHint().height() + 6);
# endif
QWidget *pHBox = new QWidget(this);
pHBox->setLayout(pLayout);
m_pInput->setEnabled(false); /* (we'll get a ready notification) */
/*
* Vertical layout box on the whole widget.
*/
QVBoxLayout *pVLayout = new QVBoxLayout();
pVLayout->setContentsMargins(0, 0, 0, 0);
pVLayout->setSpacing(5);
pVLayout->addWidget(m_pOutput);
pVLayout->addWidget(pHBox);
setLayout(pVLayout);
/*
* The tab order is from input to output, not the other way around as it is by default.
*/
setTabOrder(m_pInput, m_pOutput);
m_fInputRestoreFocus = true; /* hack */
/*
* Setup the timer.
*/
m_pTimer = new QTimer(this);
connect(m_pTimer, SIGNAL(timeout()), SLOT(updateOutput()));
/*
* Init the backend structure.
*/
m_Back.Core.pfnInput = backInput;
m_Back.Core.pfnRead = backRead;
m_Back.Core.pfnWrite = backWrite;
m_Back.Core.pfnSetReady = backSetReady;
m_Back.pSelf = this;
/*
* Create the critical section, the event semaphore and the debug console thread.
*/
int rc = RTCritSectInit(&m_Lock);
AssertRC(rc);
rc = RTSemEventCreate(&m_EventSem);
AssertRC(rc);
rc = RTThreadCreate(&m_Thread, backThread, this, 0, RTTHREADTYPE_DEBUGGER, RTTHREADFLAGS_WAITABLE, "VBoxDbgC");
AssertRC(rc);
if (RT_FAILURE(rc))
m_Thread = NIL_RTTHREAD;
/*
* Shortcuts.
*/
m_pFocusToInput = new QAction("", this);
m_pFocusToInput->setShortcut(QKeySequence("Ctrl+L"));
//.........这里部分代码省略.........